package com.example.myapplication.activity.live_activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.myapplication.R;
import com.example.myapplication.utils.DateUtil;

public class ActResponseActivity extends AppCompatActivity implements View.OnClickListener {
    private TextView tvGetSend;
    private TextView tvResponse;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_act_response);
        tvGetSend = findViewById(R.id.tv_get_send);
        tvResponse = findViewById(R.id.tv_response);
        tvGetSend.setText(getIntent().getExtras().getString("requestContent"));
        findViewById(R.id.btn_tv_response).setOnClickListener(this);
        tvResponse.setText("V我50！");
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        Bundle bundle = new Bundle();
        bundle.putString("responseTime", DateUtil.getNowTime());
        bundle.putString("responseContent", tvResponse.getText().toString());
        intent.putExtras(bundle);
        setResult(ActResponseActivity.RESULT_OK, intent);
        finish();
    }
}